# $Id: PKGBUILD 183678 2013-04-26 13:20:21Z andrea $
# Maintainer: Andrea Scarpino <andrea@archlinux.org>

pkgname=kdevelop-php
pkgver=1.5.0
_pkgver=4.5.0
pkgrel=1
pkgdesc="PHP language and documentation plugin for KDevelop/Quanta"
arch=('i686' 'x86_64')
url="http://www.kdevelop.org/"
license=('GPL')
depends=('kdevelop')
makedepends=('cmake' 'automoc4' 'kdevelop-pg-qt')
replaces=('kdevelop-php-docs')
conflicts=('kdevelop-php-docs')
source=(http://download.kde.org/stable/kdevelop/${_pkgver}/src/${pkgname}-{,docs-}${pkgver}.tar.bz2)
sha1sums=('778a1711c15458952e1e4765722a0839390f636c'
          'fa282f0ace43d36a785e608c421c91437596fc79')

build() {
  mkdir build
  cd build
  cmake ../${pkgname}-${pkgver} \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release
  make
  cd ../

  # kdevelop-php-docs
  mkdir build-docs
  cd build-docs
  cmake ../${pkgname}-docs-${pkgver} \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release
  make
}

package() {
  cd build
  make DESTDIR="${pkgdir}" install
  cd ../

  # kdevelop-php-docs
  cd build-docs
  make DESTDIR="${pkgdir}" install
}
